package com.lzt.yijian.mvp.presenter;

import android.content.Context;

import com.lzt.yijian.api.inter.ObserverOnNextListener;
import com.lzt.yijian.bean.Movie;
import com.lzt.yijian.mvp.module.HomeFragmentModule;
import com.lzt.yijian.mvp.module.HomeFragmentModuleImpl;
import com.lzt.yijian.mvp.view.fragment.HomeFragmentView;

public class HomeFragmentPresenterImpl implements HomeFragmentPresenter, ObserverOnNextListener<Movie> {
    private final Context mContext;
    private HomeFragmentModule mModule = new HomeFragmentModuleImpl();
    private HomeFragmentView mView;

    public HomeFragmentPresenterImpl(Context context, HomeFragmentView view) {
        mContext = context;
        mView = view;
    }

    @Override
    public void onNext(Movie movie) {
        mView.onGetDataDone(movie);
    }

    @Override
    public void onGetData() {
        mModule.getData(mContext, this);
    }

    @Override
    public void onError() {

    }

    @Override
    public void onRefresh(boolean isRefresh) {

    }


}
